package com.airlines.crewassignment.constant;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

/**
 * @author xxxx
 * @date 2018年5月3日 
 * @description 排班规则常量类，从配置文件获取
 */
@Component
public class RuleConstant {
	public static int REST_X;
	public static int REST_FLIGHT_BEFORE_144;;
	public static int REST_48;
	public static int REST_INTERNATIONAL_TIME_DIFF;
	public static int REST_FLIGHT_BEFORE_10;
	public static int MAX_AGE;
	public static int LIMIT_NUM_AGE;
	public static int FLIGHT_MORE_THAN_COUNT = 3; //每个人每天航段淑大于N的统计
	/**
	 * 机长和一副的间断飞行天数不能同时超过15天
	 */
	public static int W0009_LAST_FLY_DAY_DIFF_MAX;
	
	/**
	 * #机长和副驾两人年龄不能都低于30岁
	 */
	public static int W0012_AGE;
	
	/**
	 * #落地时间在20点之后，次日不安排12点前的航班
	 */
	public static int W0013_TA_HORE;
	/**
	 * #落地时间在20点之后，次日不安排12点前的航班
	 */
	public static int W0013_NEXT_DAY_TD_HORE;
	
	
	/**
	 * 落地时间在24点之后，次日不安排航班
	 */
	public static int W0014_TA_HORE;
	/**
	 * 落地时间在24点之后，次日不安排航班
	 */
	public static int W0014_NEXT_DAY_TD_HORE;
	
	public static int MAX_LIMIT_HOURS;	//局方月度限制

	public static int MAX_YEAR_HOURS;	//最大年飞
	


	@Value("${com.airlines.rule.restX}")
	public void setRestX(int restX){
		REST_X = restX;
	}
	@Value("${com.airlines.rule.restFlightBefore144}")
	public void setRestFlightBefore144(int restFlightBefore144){
		REST_FLIGHT_BEFORE_144 = restFlightBefore144;
	}
	@Value("${com.airlines.rule.rest48}")
	public void setRest48(int rest48){
		REST_48 = rest48;
	}
	@Value("${com.airlines.rule.restFlightBefore10}")
	public void setRestInternationalTimeDiff(int restInternationalTimeDiff){
		REST_INTERNATIONAL_TIME_DIFF = restInternationalTimeDiff;
	}
	@Value("${com.airlines.rule.restFlightBefore10}")
	public void setRestFlightBefore10(int restFlightBefore10){
		REST_FLIGHT_BEFORE_10 = restFlightBefore10;
	}

	@Value("${com.airlines.rule.limitNumAge}")
	public void setLimitNumAge(int limitNumAge){
        LIMIT_NUM_AGE = limitNumAge;
	}
	@Value("${com.airlines.rule.w0009.lastFlyDayDiffMax}")
	public void W0009_LAST_FLY_DAY_DIFF_MAX(int value){
		W0009_LAST_FLY_DAY_DIFF_MAX = value;
	}
	
	@Value("${com.airlines.rule.maxAge}")
	public void MAX_AGE(int value){
		MAX_AGE = value;
	}
	
	@Value("${com.airlines.rule.w0012.age}")
	public void W0012_AGE(int value){
		W0012_AGE = value;
	}
	
	
	@Value("${com.airlines.rule.w0013.taHour}")
	public void W0013_TA_HORE(int value){
		W0013_TA_HORE = value;
	}
	
	@Value("${com.airlines.rule.w0013.nextDayTdHour}")
	public void W0013_NEXT_DAY_TD_HORE(int value){
		W0013_NEXT_DAY_TD_HORE = value;
	}
	
	@Value("${com.airlines.rule.w0014.taHour}")
	public void W0014_TA_HORE(int value){
		W0014_TA_HORE = value;
	}
	
	@Value("${com.airlines.rule.w0014.nextDayTdHour}")
	public void W0014_NEXT_DAY_TD_HORE(int value){
		W0014_NEXT_DAY_TD_HORE = value;
	}
	
	@Value("${com.airlines.rule.maxLimitHours}")
	public void MAX_LIMIT_HOURS(int value){
		MAX_LIMIT_HOURS = value;
	}
	@Value("${com.airlines.rule.maxYearHours}")
	public void MAX_YEAR_HOURS(int value){
		MAX_YEAR_HOURS = value;
	}

}
